<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>优惠券列表</title>
  <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
  <meta content="yes" name="apple-mobile-web-app-capable"/>
  <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
  <meta content="telephone=no" name="format-detection"/>
  <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="__STATIC__/layer/layer.js"></script>
</head>
<body>
  {if condition="!empty($coupon)"}
    {foreach name="coupon" item="v"}
      <div>
        <a href="javascript:;" onclick="chose_coupon(this,{$v.id})">
          <img class="logo" src="{$v.img}" width="80px;" height="80px;">
          抵价金额：<span class="reduce">{$v.reduce}</span>
          满减条件：<span class="morethan">{$v.morethan}</span>
        </a>
      </div>
    {/foreach}
  {else /}
  没有任何可用的优惠券
  {/if}
</body>
</html>
<script>
  /**
   * @param  id  优惠券id
   */
  function chose_coupon(obj,id){
      var logo = $(obj).find('.logo').attr('src');
      var reduce = $(obj).find('.reduce').text();
      var morethan = $(obj).find('morethan').text();
      javascript:window.parent.select_coupon(id,logo,reduce,morethan);
  }
</script>